package com.mpc.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Log {

    private static final SimpleDateFormat sFormat = new SimpleDateFormat(
            "MM-dd HH:mm:ss");

    public static void d(String tag, String message) {
        Date current = new Date();
        System.out.println(String.format("D %s %s.%s() - %s",
                sFormat.format(current), tag, Thread.currentThread()
                        .getStackTrace()[2].getMethodName(), message));
    }

    public static void d(String tag, String message, Exception e) {
        d(tag, message);
        e.printStackTrace();
    }
    
    public static void e(String tag, String message) {
        Date current = new Date();
        System.out.println(String.format("E %s %s.%s() - %s",
                sFormat.format(current), tag, Thread.currentThread()
                        .getStackTrace()[2].getMethodName(), message));
    }

    public static void e(String tag, String message, Exception e) {
        e(tag, message);
        e.printStackTrace();
    }
}
